package study.java.jdk.jdk8._1_stream.terminal.short_circuiting;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;

/**
 * 列表中所有元素都比配我们的条件
 */
@Slf4j
public class allMatch_01_Test {

    private List<Integer> src = Arrays.asList(100, 200, 300);

    /**
     * @param predicate Predicate
     */
    @Test
    public void test() {
        boolean dest = src.stream()
                .allMatch(e -> e == 200);
        log.info("{}", dest);
    }

    @Test
    public void test2() {
        boolean dest = src.stream()
                .allMatch(e -> e > 1000);
        log.info("{}", dest);
    }
}
